package de.mmis.core.base;

import static java.lang.annotation.ElementType.*;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.Map;

import de.mmis.core.base.abstracttree.Tree;

/**
 * 
 * There must be one method annotated with the @DeserializationMethod
 * annotation. The method must have the signature<br/>
 * <code>public static TYPE METHOD({@link Tree} t, {@link ClassLoader} cl, {@link String} id, {@link Map}<String, Object> idmap)
 * throws DeserializableException</code>
 * 
 */
public interface DeserializableAnnotations {

	/**
	 * Method must have the signature<br/>
	 * <code>public static TYPE METHOD({@link Tree} t, {@link ClassLoader} cl, {@link String} id, {@link Map}<String, Object> idmap)
	 * throws DeserializableException</code>
	 * 
	 */
	@Retention(RetentionPolicy.RUNTIME)
	@Target(METHOD)
	public static @interface DeserializationMethod {
		// no annotation parameters
	}

	@Retention(RetentionPolicy.RUNTIME)
	@Target(TYPE)
	public static @interface ObjectDeserializable {
		// no annotation parameters
	}

	@Retention(RetentionPolicy.RUNTIME)
	@Target(CONSTRUCTOR)
	public static @interface DeserializationConstructor {
		// no annotation parameters
	}

	@Retention(RetentionPolicy.RUNTIME)
	@Target(TYPE)
	public static @interface ConstructorDeserializable {
		String typeIdentifier();
	}

	@Retention(RetentionPolicy.RUNTIME)
	@Target(TYPE)
	public static @interface EnumDeserializable {
		String typeIdentifier();
	}
}
